<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>shift()</title>
	</head>
	<body>
		<script>
			// shift() 用于删除数组中第一个元素，并返回其值
			// 此方法改变数组长度

			let arr = [1, 2, 3, 4, 5];
			let firstElement = arr.shift();
			console.log(firstElement);
			console.log(arr);
		</script>
	</body>
</html>
